/* *********************************************************
 Interrupts declaration
 ********************************************************* */
void IRQ_Routine(void) __attribute__ ((interrupt("IRQ")));
void FIQ_Routine(void) __attribute__ ((interrupt("FIQ")));
void SWI_Routine(void) __attribute__ ((interrupt("SWI")));
void UNDEF_Routine(void) __attribute__ ((interrupt("UNDEF")));

/**********************************************************
 Header files
 **********************************************************/
#include "system.h"

/**********************************************************
 MAIN
 **********************************************************/

void initialize(void) {
	// Init System clock, PLL and MAM
	system_Init();

	// init P0.12 as output
	io_SetOutputPin(0,12);
}

int main(void) {
	initialize();

	while(1) {
		io_SetPin(0,12);
		delay_ms(500);
		io_ClearPin(0,12);
		delay_ms(500);
	}

	while (1);
	return 0;
}

/*  Stubs for various interrupts (may be replaced later)  */
/*  ----------------------------------------------------  */
void IRQ_Routine(void) {
	while (1)
		;
}
void FIQ_Routine(void) {
	while (1)
		;
}
void SWI_Routine(void) {
	while (1)
		;
}
void UNDEF_Routine(void) {
	while (1)
		;
}
